home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac: Not for Sale / Another.not.for.sale (Australia).iso / fade into you / getting there / TCP⁄PPP⁄SLIP / Scripts / scr-freds-zen-interslip-script < prev    next >
Encoding:
Text File  |  1994-03-11  |  4.9 KB  |  121 lines  |  [TEXT/R*ch]

  1. ! (c) copyright 1994, Fred Morris, Seattle, WA. You may post this file
  2. ! to your favorite ftp site or on-line service one time, provided
  3. ! that you e-mail me telling me where.  You may share this file with
  4. ! your friends or clients provided that you do not charge them for it
  5. ! per se. Exceptions: Elliotte Harold, you have to ask before you
  6. ! even use it;  Adam Engst, you can do anything you want with it;
  7. ! InterConn, you can include this script with InterSLIP if you wish.
  8. ! Contact me via e-mail at m3047@halcyon.com,  or finger that account
  9. ! for additional information.  Yeah, I am a guru, but I believe in the
  10. ! cult of experience and I don't suffer fools;  you've been warned,
  11. ! think carefully before importuning me with questions that you could
  12. ! have answered on your own in the time it takes you to compose e-mail
  13. ! and me to answer it.
  14. !
  15. ! Fred's zen way InterSLIP dialing script.  It's simple.  It's easy to
  16. ! understand.  It won't cook your breakfast.  It does what it does
  17. ! and that's it.  Retry on busy was added at Adam Engst's request.
  18. ! Written as a reaction to the pompous and intricate-to-the-point-of
  19. ! -fragility crap that modem manufacturers and Apple itself ship.
  20. ! Your modem must be configured to send CONNECT and BUSY responses for
  21. ! this script to work correctly.  See your modem documentation if
  22. ! you're not sure how your modem sets up by default.  The script
  23. ! assumes that your modem uses "AT" to initiate command sequences and
  24. ! that it recognizes "+++" as the attention sequence and that "ATH"
  25. ! will hang up the line.
  26. !
  27. ! The InterSLIP documentation has pretty good explanations of the
  28. ! commands used here (and some others as well).  Apple's own CCL
  29. ! scripts use the same commands (more or less).  To edit an Apple
  30. ! CCL, use a disk editor to change the type of the file from 
  31. ! "mlts" to "TEXT" and the creator (if you wish) from "slnk" to
  32. ! "ttxt",  then edit with any text file editor.  Change the type
  33. ! and creator back before trying to use the script.  ARAPS 2.0 doesn't
  34. ! display notes;  total bogosity, Apple, it ain't gonna sell ARA
  35. ! development kits if I can do anything about it.  If you have to hack
  36. ! an ARA script, my best debugging suggestion is to use exit -1 to
  37. ! generate breaks.  Or order the development kit from APDA. Not that
  38. ! I'd do that, but maybe some sucker will.
  39. !
  40. ! *****************************************************************
  41. ! This section of the script is executed when you click the connect
  42. ! button.
  43. @originate            ! Standard CCL label for this section
  44. !
  45. ! We will come back here if BUSY is detected.
  46. @label 5            ! Creates "line number" 5 for use as a
  47.                                 ! branch destination.
  48. !
  49. ! Display status for the user.
  50. note "initializing modem"    ! note displays the quoted string in the
  51.                 ! InterSLIP status area.
  52. !
  53. ! Initialize the modem.
  54. write "^4\13"            ! write sends a string to the modem.
  55.                 ! ^4 substitutes the initialization string
  56.                 ! specified in the InterSLIP setup;  this
  57.                 ! may be specific to InterSLIP or InterConn.
  58.                 ! Possible bug: it didn't seem to like
  59.                 ! multiple substitutions in the same string.
  60.                 ! \13 sends a carriage return.
  61. pause 20            ! pause waits.  I think the unit is 10ths
  62.                 ! of a second,  but I'm probably wrong.
  63. !
  64. ! Tell the user what number we're dialing and then dial it.
  65. note "dialing ^1"        ! ^1 substitutes the dial string specified
  66.                 ! in the InterSLIP setup.
  67. write "atdt^1\13"        ! ACE - changed to "atdt"
  68. !
  69. ! Wait for Godot..
  70. matchstr 1 5 "BUSY"        ! matchstr sets a trigger on the specified
  71.                 ! string.  the first number is some sort
  72.                 ! of trigger identifier.  the second number
  73.                 ! is the "line number" to branch to if
  74.                 ! the trigger goes off. the last parameter
  75.                 ! is the string to trigger on.
  76. matchstr 2 20 "CONNECT"        
  77. matchread 500            ! matchread puts the script into a receptive
  78.                 ! mode with the matchstr triggers active.
  79.                 ! the parameter is how long to wait for one
  80.                 ! of the triggers to fire.
  81. !
  82. ! If neither "CONNECT" nor "BUSY" is seen in 50 seconds, we fall through
  83. ! to here.
  84. @label 10
  85. note "Dial Failed!"
  86. exit -1                ! exit terminates execution of the script at
  87.                 ! this point. if the parameter is -1 there
  88.                 ! has been an error.  if the parameter is 0
  89.                 ! then the script finished successfully.
  90. !
  91. ! We jump here if "CONNECT" is seen.
  92. @label 20
  93. note "dialed successfully"
  94. exit 0
  95. !
  96. ! *****************************************************************
  97. ! I never use answer mode with InterSLIP.  I doubt you do, either.
  98. @answer                ! This is the standard label where execution
  99.                 ! would begin if auto-answer was supported.
  100. exit -1
  101. !
  102. ! *****************************************************************
  103. ! This section of the script is executed when you click the disconnect
  104. ! button.
  105. @hangup                ! This is the standard CCL label where
  106.                 ! execution is to begin when hanging up the
  107.                 ! modem.
  108. !
  109. ! Tell the user what's happening.
  110. note "hanging up modem"
  111. !
  112. ! Get the modem's attention.
  113. write "+++"
  114. pause 60
  115. !
  116. ! Tell it to hang up the phone.
  117. write "ath\13"
  118. !
  119. ! We're happy now.
  120. exit 0
  121.